home *** CD-ROM | disk | FTP | other *** search
- **************** Invprint COMMAND FILE ********************
- * Prints invoice forms.
- * Printing can be put off until later.
- * Entries can be edited if they do not print correctly.
- ***************************************************************************
- *
- SELECT 1
- GO TOP
- *
- CLEAR
- IF EOF()
- ? 'There are no invoices to print.'
- WAIT 'Type any key to continue'
- ELSE
- ?
- ? 'DO NOT PRINT THESE ENTRIES IF THERE ARE ANY ERRORS!'
- ? 'Once they are printed you cannot edit them!!!'
- ?
- ? 'INV # JOB # DESCRIPTION TAXABLE ';
- + 'TAX NO TAX'
- DO WHILE .NOT. EOF()
- IF .NOT. DELETED()
- ? Inv_Nmbr,Client+STR(Job_Nmbr,4),SUBSTR(Descrip,1,25),Taxable,;
- Sales_Tax,TaxFree
- ENDIF
- SKIP
- ENDDO
- ?
- WAIT 'DO you want to print them now (Y or N)? ' TO Hardcopy
- ENDIF
- *
- IF UPPER(Hardcopy) <> 'Y'
- @ ROW(),0 SAY 'Preparing to update invoice transaction '
- RETURN
- ENDIF
- CLEAR
- ? ' Prepare To Print Invoices '
- ?
- ? '1> Load a batch of invoice forms in the sheet feeder.'
- ?
- ? '2> Press RESET, then move the first form into position.'
- ?
- ? '3> Line up the top of the form with the white mark.'
- ?
- WAIT 'Now press any key to print the form.'
- *
- *
- SET PRINT ON
- GO TOP
- DO WHILE .NOT. EOF()
- IF DELETED()
- SKIP
- LOOP
- ELSE
- CLEAR
- ? SPACE(29) + '*****************'
- ? SPACE(29) + ' I N V O I C E'
- ? SPACE(29) + '*****************'
- ?
- ? ' INVOICE #: '+ Inv_Nmbr + SPACE(37) + 'DATE:', Inv_Date
- ?
- *
- * We check to see if we have a listing in our client address file.
- * If not, the user can enter a name and address from the keyboard.
- SELECT 7
- LOCATE FOR Name = TRIM(A->Client)
- IF EOF()
- SET PRINT OFF
- APPEND BLANK
- REPLACE NAME WITH A->Client
- CLEAR
- @ 2, 0 SAY 'No billing address for this invoice in our files.'
- @ 4, 0 SAY 'Client #: '+A->Client+' Job #; '+STR(A->Job_Nmbr,4)+;
- ' Description: '+SUBSTR(A->Descrip,1,25)
- @ 6, 0 SAY 'Enter the name and address for billing:'
- @ 8, 0 SAY ' COMPANY ' GET Line1
- @ 9, 0 SAY ' ADDRESS ' GET Line2
- @ 10, 0 SAY ' ' GET Line3
- @ 11, 0 SAY ' ' GET Line4
- @ 12, 0 SAY ' ATTENTION OF ' GET Line5
- Correct = 'Y'
- DO WHILE UPPER(Correct) <> 'N'
- @ 13, 0 CLEAR
- READ SAVE
- WAIT 'Any corrections (Y or N)? ' TO Correct
- ENDDO
- CLEAR GETS
- SET PRINT ON
- ENDIF
- ? ' BILLED TO: ' + TRIM(Line1)
- ? ' ' + TRIM(Line2)
- ? ' ' + TRIM(Line3)
- ? ' ' + TRIM(Line4)
- ? ' ' + TRIM(Line5)
- ?
- ? ' ----------------------------------'+;
- '--------------------------------------'
- ?
- ? SPACE(58) + 'TAXABLE SERVICE'
- SELECT 1
- STORE 0 TO LineCnt, Taxed, State, Service, Final
- MaxLines = 33
- Page = 1
- SameJob = .F.
- TempInv = Inv_Nmbr
- DO WHILE .NOT. EOF() .AND. TempInv = Inv_Nmbr
- * Print blanks when the entry is zero.
- IF Taxable = 0
- First = ' '
- ELSE
- First = STR(Taxable,11,2)
- ENDIF
- IF TaxFree = 0
- Second = ' '
- ELSE
- Second = STR(TaxFree,11,2)
- ENDIF
-
- IF SameJob
- ? ' ' + Descrip + First + Second
- ELSE
- IF PO_Nmbr <> ' '
- ? SPACE(4)+Client+'-'+STR(Job_Nmbr,4) +' (P.O.# '+ TRIM(PO_Nmbr) +'):'
- ELSE
- ? SPACE(4)+Client + '-' + STR(Job_Nmbr,4) + ':'
- ENDIF
- LineCnt = LineCnt + 1
- ? ' ' + Descrip + First + Second
- ENDIF
- LineCnt = LineCnt + 1
- Taxed = Taxed + Taxable
- State = State + Sales_Tax
- Service = Service + TaxFree
- *
- SKIP
- *
- IF Page > 1
- MaxLines = 38
- ENDIF
- *
- IF LineCnt > MaxLines
- ?
- DO Invsubto
- ?
- ?
- ?
- ? ' (...continued on next page...)'
- Page = Page + 1
- * Formfeed
- EJECT
- LineCnt = 0
- ?
- ?
- ? ' Invoice '+ 'Number ' + Inv_Nmbr +;
- ', page '+ STR(Page,2) + '...'
- ?
- ? ' ----------------------------------'+;
- '--------------------------------------'
- ?
- ? SPACE(26) + 'TAXABLE SERVICE'
- DO Invsubto
- ?
- ENDIF
- ENDDO
- *
- Final = Taxed + State + Service
- *
- DO Invsubto
- *
- * Position the totals near the bottom of the form
- DO WHILE LineCnt < 33
- SET CONSOLE OFF
- ?
- LineCnt = LineCnt + 1
- SET CONSOLE ON
- ENDDO
- *
- IF State > 0
- ?
- ? SPACE(11) + 'State Sales Tax:' + SPACE(40) + STR(State,9,2)
- ENDIF
- ?
- ? ' ----------------------------------'+;
- '--------------------------------------'
- ?
- ? SPACE(42) + 'TOTAL DUE: '+SPACE(10)+'$' + STR(Final,11,2)
- ?
- ? SPACE(42) + 'Terms: Net 10 days.'
- *
- EJECT
- ENDIF
- ENDDO eof
- SET PRINT OFF
- *
- RETURN